package com.alipay.app.groupmeal.standard.ui.c;

import android.content.Context;
import android.content.Intent;
import android.view.KeyEvent;

import com.alipay.app.groupmeal.standard.R;
import com.alipay.app.groupmeal.standard.base.BaseMVCActivity;
import com.alipay.app.groupmeal.standard.event.EventManager;
import com.alipay.app.groupmeal.standard.ui.b.function.CardPre;
import com.alipay.app.groupmeal.standard.ui.b.function.OrderPre;
import com.alipay.app.groupmeal.standard.ui.c.abcp.CPayingAbcpActivity;
import com.alipay.app.groupmeal.standard.ui.c.pre.UCardPre;

import org.greenrobot.eventbus.EventBus;

public class CCardActivity extends BaseMVCActivity {

    private UCardPre uCardPre;

    private OrderPre orderPre;

    public static void startAct(Context context) {
        Intent intent = new Intent(context, CCardActivity.class);
        context.startActivity(intent);
    }
    @Override
    public boolean onKeyEventBack(KeyEvent event) {
        finish();
        return super.onKeyEventBack(event);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_card;

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void dissmissPresnetation() {
        if (orderPre != null) {
            orderPre.dismiss();
        }
        if (uCardPre!=null){
            uCardPre.dismiss();
        }
    }

    @Override
    public void onBusiness() {
        super.onBusiness();
        showPresentationAtMain(uCardPre);
    }

    @Override
    public void initPresentation() {
        super.initPresentation();
        if (mMainDisplay != null) {
            uCardPre = new UCardPre(CCardActivity.this, mMainDisplay);
            registerPresentation(uCardPre);
        }

        if (mDisplay != null) {
            orderPre = new OrderPre(CCardActivity.this, mDisplay);
            registerPresentation(orderPre);
            showPresentation(orderPre);
            orderPre.shows();
        }
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
    }


}
